package cn.edu.seig.springboot.mapper;

import cn.edu.seig.springboot.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Select("SELECT * FROM user WHERE username = #{username} AND password = #{password} AND role = #{role} AND status = 1")
    User login(String username, String password, String role);
    
    @Select("SELECT id, username, role, real_name as realName, phone, email, status FROM user WHERE id = #{id}")
    User getUserById(Integer id);
}
